/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.facturacion.modelo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "fctcii")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "OALIAS", discriminatorType = DiscriminatorType.STRING, length = 2)
public class FC_ItemCircuito implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected FC_ItemCircuitoPK idPK;

    @JoinColumns({
    @JoinColumn(name = "FCTCII_CIRAPL", referencedColumnName = "PDTCIH_CIRAPL", nullable = false, insertable=false, updatable=false),
    @JoinColumn(name = "FCTCII_CIRCOM", referencedColumnName = "PDTCIH_CIRCOM", nullable = false, insertable=false, updatable=false)
    })
    @ManyToOne
    FC_Circuito circuito;

    @Column(name = "FCTCII_MODULO", nullable = false, insertable=false, updatable=false, length = 2)
    private String modulo;

    @Column(name = "FCTCII_CODCOM", nullable = false, insertable=false, updatable=false, length = 6)
    private String codcom;

    @Column(name = "FCTCII_OBSERVA", length = 60)
    private String observaciones;



    public FC_ItemCircuito() {
    }

    public FC_ItemCircuito(FC_ItemCircuitoPK fC_ItemCircuitoPK) {
        this.idPK = fC_ItemCircuitoPK;
    }

    public FC_ItemCircuito(String fctciiCirapl, String fctciiCircom, String fctciiModulo, String fctciiCodcom) {
        this.idPK = new FC_ItemCircuitoPK(fctciiCirapl, fctciiCircom, fctciiModulo, fctciiCodcom);
    }

    public FC_ItemCircuitoPK getFC_ItemCircuitoPK() {
        return idPK;
    }

    public void setFC_ItemCircuitoPK(FC_ItemCircuitoPK fC_ItemCircuitoPK) {
        this.idPK = fC_ItemCircuitoPK;
    }

    public FC_Circuito getCircuito() {
        return circuito;
    }

    public void setCircuito(FC_Circuito circuito) {
        this.circuito = circuito;
    }

    public String getCodcom() {
        return codcom;
    }

    public void setCodcom(String codcom) {
        this.codcom = codcom;
    }

    public FC_ItemCircuitoPK getIdPK() {
        return idPK;
    }

    public void setIdPK(FC_ItemCircuitoPK idPK) {
        this.idPK = idPK;
    }

    public String getModulo() {
        return modulo;
    }

    public void setModulo(String modulo) {
        this.modulo = modulo;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }
    


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPK != null ? idPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FC_ItemCircuito)) {
            return false;
        }
        FC_ItemCircuito other = (FC_ItemCircuito) object;
        if ((this.idPK == null && other.idPK != null) || (this.idPK != null && !this.idPK.equals(other.idPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "isd.facturacion.modelo.FC_ItemCircuito[fC_ItemCircuitoPK=" + idPK + "]";
    }

}
